package com.haizhen.horizontalscrollslideview

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.haizhen.horizontalscrollslideview.databinding.ItemTestBinding

class RecyclerStringAdapter : BaseQuickAdapter<String, ViewHolder>() {
    override fun onBindViewHolder(holder: ViewHolder, position: Int, item: String?) {
        holder.binding.textItem.text = item
    }

    override fun onCreateViewHolder(context: Context, parent: ViewGroup, viewType: Int): ViewHolder {
        return  ViewHolder(parent)
    }
}

class ViewHolder(parent: ViewGroup,
    val binding: ItemTestBinding = ItemTestBinding.inflate(LayoutInflater.from(parent.context), parent, false)) :
        RecyclerView.ViewHolder(binding.root)
